<template>
  <div class="alert-tips">
    <div v-for="(tip, index) in props.tips" :key="index" class="alert-item">
      <div class="alert-text">{{ `${index + 1}. ${tip}` }}</div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
const props = defineProps({
  tips: {
    type: Array,
    default: () => [],
  },
});
const tips = ref([{ text: '库存不足' }, { text: '单次用量超过单次最大用量' }]);
</script>

<style scoped>
.alert-tips {
  background-color: #FFF1E9;
  border-radius: 8px;
  overflow: hidden;
  padding: 5px 16px;
  width: 246px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-item {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #333;
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-icon {
  margin-right: 8px;
  flex-shrink: 0;
}

.alert-text {
  flex: 1;
  color: #e37318;
}
</style>
